/**
 * 
 */
package org.extdev.libraries.ltr;


/**
 * @author LAP
 *
 */
public class LTRExceptionGenerator implements LTRAPIConstants {
	public static void throwLTRException(int exceptionNo) throws LTRException {
		switch(exceptionNo) {
		case LTR_ERROR_UNKNOWN: throw new LTRException("Uncnown error", LTR_ERROR_UNKNOWN); 
		case LTR_ERROR_PARAMETRS: throw new LTRException("Paremeters error", LTR_ERROR_PARAMETRS); 
		case LTR_ERROR_MEMORY_ALLOC: throw new LTRException("Memory allocation error", LTR_ERROR_MEMORY_ALLOC); 
		case LTR_ERROR_OPEN_CHANNEL: throw new LTRException("Open channel error", LTR_ERROR_OPEN_CHANNEL); 
		case LTR_ERROR_OPEN_SOCKET: throw new LTRException("Socket open error", LTR_ERROR_OPEN_SOCKET); 
		case LTR_ERROR_CHANNEL_CLOSED: throw new LTRException("Close channel error", LTR_ERROR_CHANNEL_CLOSED); 
		case LTR_ERROR_SEND: throw new LTRException("Send error", LTR_ERROR_SEND); 
		case LTR_ERROR_RECV: throw new LTRException("Receive error", LTR_ERROR_RECV); 
		case LTR_ERROR_EXECUTE: throw new LTRException("LTRCrate controller execute action Error", LTR_ERROR_EXECUTE); 
		case LTR_WARNING_MODULE_IN_USE: throw new LTRException("Module was in use", LTR_WARNING_MODULE_IN_USE); 
		case LTR_ERROR_NOT_CTRL_CHANNEL: throw new LTRException("Only with CC_CONTROL", LTR_ERROR_NOT_CTRL_CHANNEL);
		}
	}
}
